import {mkTab} from './tab'
import copyright from "../../copyright"

function TabCompoennt(props){
  return mkTab(props.pageParam)
}

export default function(Pager) {
  return Pager({
    data: {},
    onLoad(param){
      this.setData({
        pageParam: param
      })
    },
    template(state, props) { 
      let pageParam = state.pageParam
      let id = pageParam.id
      let catTitle = '新增文档'
      if (id) catTitle = '编辑文档'
      return (
        <>
          <View className="ss-card pages-title-lg">{catTitle}</View>
          <View className='ss-card m-default'>
            <TabCompoennt pageParam={state.pageParam}/>
          </View>
          <copyright.UI />
        </>
      )
    }
  })
}